package me.chenqiang.tre.entity;

import java.util.Set;

/**
 * 表示卡片的示例类，可以扩展各种类型的参数
 */
public class Card {
	private String cardNo;
	private String holderName;
	private String holderType;
	private Set<String> holderTag;
	
	public Card(String cardNo, String holderName, String holderType, Set<String> holderTag) {
		super();
		this.cardNo = cardNo;
		this.holderName = holderName;
		this.holderType = holderType;
		this.holderTag = holderTag;
	}
	
	public String getCardNo() {
		return cardNo;
	}
	public String getHolderName() {
		return holderName;
	}
	public String getHolderType() {
		return holderType;
	}
	public Set<String> getHolderTags() {
		return holderTag;
	}

	@Override
	public String toString() {
		return String.format("持卡人%s 卡号%s 类型%s 标签%s", this.holderName, this.cardNo, this.holderType, 
				(this.holderTag == null || this.holderTag.isEmpty()) ? "无" : String.format("（%s）", String.join(",", holderTag)));
	}
}
